	<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <script type="text/javascript" src="../js/jquery-3.3.1.js"></script>
    <body>
    	<form action="index.jsp" method="post">
    		分区名<input type="text" id="zoneParkingName"></br>
    		总车位数<input type="number" id="total"></br>
    		<input id="add" type="submit" value="添加">
    	</form>
    </body>
    <script type="text/javascript">
    	$(function(){
    		$("#add").click(function(){
    			var zoneParkingName = $("#zoneParkingName").val();
    			var total = $("#total").val();
    			if(zoneParkingName!="" && total!=""){
    				$.ajax({
    					url:'addzoneparking',
    					method:'get',
    					contentType:'application/json',
    					dataType:'json',
    					data:{
    						'zoneParkingName':zoneParkingName,
    						'total':total
    					},
    					success:function(data){
    						if(!data)
    							alert("添加失败");
    					}
    				});
    			}
    		});
    	})
    </script>
</html>